package com.hsl.study.config;

import com.hsl.study.interceptor.DemoInterceptor;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author: hsl
 * @CreateTime: 2025-02-14  20:31
 * 配置拦截规则
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Resource
    private DemoInterceptor demoInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(demoInterceptor).addPathPatterns("/**");
    }
}
